<template>
	<view>
		<view class="view1" v-for="(v,i) in arr" :key="i">
			<view class="view1-1">{{arr[i].org_Name}}</view>
			<view class="view1-2">
				<view class="v1">
					<text>
						<text>{{arr[i].user_name}} </text>
						<text> {{arr[i].user_tel}}</text>
					</text>
					<text>
						<text>体检时间</text>
						<text>{{getDate(arr[i].order_date)}}</text>
					</text>
				</view>
				<view class="v2">
					<view>
						<button type="primary" plain="true" @click="look(i,v.order_orderId)">查看</button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				arr:[]
			}
		},
		mounted(){
			this.$http({   //获取我的体检列表
				url:"/getreport",
				data:{
					user_tel:15184462493,
					order_status:2
				}
			}).then((res)=>{
				console.log(11,res)
				this.arr=res.data
			})
		},
		methods: {
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();
	
				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
			look(a,b){
				uni.navigateTo({
				    url:'/pages/HXM/LookReport/LookReport',
				})
			}
		}
	}
</script>

<style lang="less">
	body{
		background: #F8F8F8;
		}
		
	.view1{
		margin: 20rpx 10rpx;
		border-radius: 10rpx;
		background: white;
		font-size: 30rpx;
		.view1-1{
			border-bottom: 2rpx solid #C1C1C1;
			height: 50rpx;
			line-height: 50rpx;
			font-weight: 600;
			padding: 10rpx 0 10rpx 10rpx;
		}
		.view1-2{
			.v1{
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				height: 60rpx;
				padding: 10rpx;
				line-height: 60rpx;
			}
			.v2{
				display: flex;
				justify-content:flex-end;
				margin: 10rpx;
				height: 80rpx;
				button{
					width: 100rpx;
					height: 60rpx;
					font-size: 30rpx;
					line-height: 60rpx;
					padding: 0rpx;
				}
			}
			
		}
	}
</style>
